package com.ulic.customerManApplication.commonmodule.bo;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.ulic.customerManApplication.usermodule.bo.User;

@Entity
@Table(name = "T_GYW_LOG")
@SequenceGenerator(name="log_seq",sequenceName="S_GYW_LOG_ID")
public class Log {
	private int oid;
	// 用户
	private User user;
	// 记录时间
	private Date time;
	// IP
	private String ip;
	// 类型。1:登录,2:操作;
	private int type;
	// 内容
	private String content;

	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="log_seq")
	public int getOid() {
		return oid;
	}

	public void setOid(int oid) {
		this.oid = oid;
	}

	@ManyToOne(targetEntity = User.class, fetch = FetchType.EAGER, optional = true)
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

}
